package com.example.designpattern.singleton;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAspect {

    private int count;

    @Pointcut("execution (public * com.example.designpattern.singleton.Test.f1(..))")
    public void p(){

    }

    @Before("p()")
    public void myBefore(){
        System.out.println("--------------beforeMethod---------------: "+count++);
    }

}
